package com.jiamingZhao.pojo.entity.base;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author ：JiaMing Zhao
 * @since ：2025/6/5 11:53
 */
@Data
@Accessors(chain = true)
@ToString
public class BaseEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "主键id")
    //@TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人", hidden = true)
    private Long createUser;
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建部门", hidden = true)
    private Long createDept;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间", hidden = true)
    private Date createTime;
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "更新人", hidden = true)
    private Long updateUser;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间", hidden = true)
    private Date updateTime;
    @Schema(description = "业务状态", hidden = true)
    private Integer status;
    //@TableLogic
    @Schema(description = "是否已删除", hidden = true)
    private Integer isDeleted;
}
